package com.example.wenziyouxi;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class sevenActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_seven);
        Intent intent=getIntent();
        String name=intent.getStringExtra("name");
        Toast.makeText(sevenActivity.this,name,Toast.LENGTH_SHORT).show();
        final Button button1=(Button)findViewById(R.id.button1);
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(sevenActivity.this,oneActivity.class);
                intent.putExtra("name",button1.getText().toString().trim());
                startActivity(intent);
            }
        });
    }
}
